package com;

import java.util.HashSet;

public class test02 {
    public static void main(String[] args) {

        int[] a={1,2,3};
        int[] b={2,3,4};
        HashSet set = new HashSet();
        for (int i=0;i<a.length;i++){
            set.add(a[i]);
        }
        System.out.println("set = " + set);
        for (int i=0;i<b.length;i++){

            boolean remove = set.remove(b[i]);
            if (remove){
                System.out.println(b[i]);
            }
//            boolean contains = set.contains(b[i]);
//            if (contains){
//                System.out.println(b[i]);
//            }
        }

        for (int e:a){
            System.out.println(e);
        }

    }
}
